package cn.edu.lingnan.dao;

public class StudentMapperProxy implements StudentMapper{
    private StudentMapper studentMapper;

    public void setStudentMapper(StudentMapper studentMapper) {
        this.studentMapper = studentMapper;
    }

    @Override
    public void query() {
        log(Thread.currentThread().getStackTrace()[1].getMethodName());
        studentMapper.query();
    }

    @Override
    public void insert() {
        log(Thread.currentThread().getStackTrace()[1].getMethodName());
        studentMapper.insert();
    }
    public void log(String string){
        System.out.println("执行了"+string+"方法");
    }
}
